﻿//===========================[ 8 / 2 / 2011 LVI ]==========================
//				Copyright c Vitaly Lyaschenko <SkyChameleon@gmail.com>
// 								Header file
// Purpose: 
//=========================================================================
#pragma once

#include "cSceneManager.h"

///////////////////////////////////////////////////////////////////////////
// видимые объекты
class Shape
{
public:
	Shape();
	~Shape();

	bool init( const std::string& fileName, cEffect *pEffect, bool buildFlag = false );
	void release();
	void draw();

	mat4 &modelMtr()
	{
		return mtrModel;
	}

	void update();

private:
	void build();
	bool m_buildFlag;

	cRenderDevice *m_pRender;
	cLuaScript    *m_pScript;

	cMesh    *m_Model;
	cEffect  *m_pEffect;
	cMaterial m_Material;
	cTexture *m_Texture;

	mat4 mtrModel;

	std::vector<cVAO *> m_VAO;
	std::vector<cVBO *> m_VBO_Pos,
						m_VBO_Normal,
						m_VBO_TexCoor,
						m_VBO_Indices;
};